package tuple;

import tuple.entity.EntityRule;
import tuple.entity.MyEntity;

import java.io.IOException;
import java.util.List;
import java.util.Set;

import static tuple.entity.EntityRule.ENTITY_PATTERNS;
import static tuple.entity.EntityRule.checkMethodNameAsEntity;


public class TestEntityRule {
    public static void main(String[] args) throws IOException {
        EntityRule.ensureEntityLoaded();
        List<String> strings = ENTITY_PATTERNS.keySet().stream().sorted().toList();
        for (String string : strings) {
            System.out.println(string.toLowerCase() + "(\"" + string.toLowerCase() + "\"),");
        }
        System.out.println("Test");
        Set<MyEntity> s = checkMethodNameAsEntity("get_Google_Map");
        assert s.contains(MyEntity.google);
        System.out.println(s);

        s = checkMethodNameAsEntity("get_element");
        System.out.println(s);

        s = checkMethodNameAsEntity("get_eleme_order");
        System.out.println(s);

        s = checkMethodNameAsEntity("get_elemeDelivery");
        System.out.println(s);

        s = checkMethodNameAsEntity("get_FacebookLocation");
        System.out.println(s);
        assert s.contains(MyEntity.facebook);
    }
}
